<template>
    <div class="app-container">
        <FilterForm ref="FilterForm" :data="filterData" @search="getList" />

        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <Export
                    :api="$Api.woodPurchase.order.export"
                    />
            </el-col>
        </el-row>

        <Table
            :api="$Api.woodPurchase.order.track"
            :selection="true"
            @select="handleSelectionChange"
            ref="Table"
            height="60vh"
        >
            <el-table-column label="ID" align="center" type="index" />
            <el-table-column label="品名" align="center" prop="goodsName" />
            <el-table-column label="品牌" align="center" prop="brandName" />
            <el-table-column label="等级" align="center" prop="level" />
            <el-table-column label="厚度" align="center" prop="ply" />
            <el-table-column label="宽度" align="center" prop="width" />
            <el-table-column label="长度" align="center" prop="length" />
            <el-table-column label="采购数量" align="center" prop="buyCount" />
            <el-table-column label="入库数量" align="center" prop="inCount" />
            <el-table-column label="在途数量" align="center" prop="wayCount" />
            <el-table-column
                label="未入库数量"
                align="center"
                prop="notInCount"
                width="100"
            />
            <el-table-column label="单价" align="center" prop="price" />
            <el-table-column label="金额" align="center" prop="money" />
            <el-table-column
                label="供应商"
                align="center"
                prop="subSupplierName"
                show-overflow-tooltip
                width="120"
            />
            <el-table-column
                label="开证公司"
                align="center"
                prop="subPactName"
                show-overflow-tooltip
                width="120"
            />
            <el-table-column
                label="仓库"
                align="center"
                prop="warehouse"
                show-overflow-tooltip
                width="120"
            />
            <el-table-column
                label="开证合同"
                align="center"
                prop="subPactNum"
                show-overflow-tooltip
                width="120"
            />
            <el-table-column label="制单人" align="center" prop="subCreateBy" />
            <el-table-column
                label="交货日期"
                align="center"
                prop="subShippingTime"
            />
            <el-table-column
                label="合同日期"
                align="center"
                prop="subInvoicesTime"
            />
            <el-table-column label="港口" align="center" prop="subHarbor" />
            <el-table-column
                label="交货方式"
                align="center"
                prop="subDeliveryType"
            />
            <el-table-column
                label="是否含THC"
                align="center"
                key="subIsThc"
                width="90"
            >
                <template slot-scope="scope">
                    <span v-if="scope.row.subIsThc == 1">是</span>
                    <span v-else>否</span>
                </template>
            </el-table-column>
            <el-table-column
                label="订单号"
                align="center"
                prop="orderId"
                fixed="right"
                width="100"
            />
            <el-table-column
                label="状态"
                align="center"
                prop="goodStatus"
                fixed="right"
                width="100"
            >
                <template slot-scope="scope">
                    <span>{{goodStatus[scope.row.goodStatus]}}</span>
                    <span></span>
                </template>
            </el-table-column>
            <el-table-column label="备注" align="center" prop="remark" />
        </Table>
    </div>
</template>

<script>

export default {
    data() {
        return {
            goodStatus: ["未入库", "部分入库", "全部入库",'关闭'],
            filterData: [
                {
                    label: "合同日期",
                    type: "period_date",
                    st: "subBeginRegisterTime",
                    end: "subEndRegisterTime",
                    scale: 2,
                },

                { label: "订单号", name: "orderId" },
                {
                    label: "开证公司",
                    name: "subPactName",
                    type: "supplier",
                },
                {
                    label: "品名",
                    name: "goodsName",
                    type: "select",
                    select: "goodsName",
                },
                {
                    label: "等级",
                    name: "level",
                    type: "select",
                    select: "levelName",
                },
                {
                    label: "厚度",
                    name: "ply",
                    type: "number",
                },
                {
                    label: "宽度",
                    name: "width",
                    type: "number",
                },
                {
                    label: "订单状态",
                    type: "select",
                    name: "goodStatus",
                    select: {
                        option: [
                            {
                                value: "0",
                                label: "未入库",
                            },
                            {
                                value: "1",
                                label: "部分入库",
                            },
                            {
                                value: "2",
                                label: "全部入库",
                            },
                            {
                                value: "3",
                                label: "已关闭",
                            },
                        ],
                        selectLabel: "label",
                        selectValue: "value",
                    },
                },
            ],
        };
    },
    created() {},
    methods: {
        /** 查询采购订单商品列表列表 */
        getList(params) {
            this.$refs.Table.getData(params);
        },
        // 多选框选中数据
        handleSelectionChange(selection) {

        },
    },
};
</script>
